<template>
  <div>
    <el-button @click="ceshi">测试111</el-button>
    <!-- <el-image
      style="width: 100px; height: 100px"
      src="http://kong-8000.pcloud.sunnyoptical.cn/crm-file/upload/file/upload/getFile2?path=/crmdata/crm-file/swipe/306b462abe474c72b8d158670d107858.png"
    >
      </el-image> -->
    <kunkka-form-table-dialog @toggleSelectRow="toggleSelectRow" @toggleClick="toggleClick">
      <template v-slot:action>
        <ux-table-column fixed="right" title="操作" width="100">
          <template slot-scope="scope">
            <el-button
              type="text"
              size="small"
            >操作</el-button>
          </template>
        </ux-table-column>
      </template>
    </kunkka-form-table-dialog>

    <!-- <kunkka-tinymce /> -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  data() {
    return {
      action:
        'https://imhome.sunnyoptical.cn/impreset/file/upload/cloudUploadFile',
      uploadAction:
        'https://imhome.sunnyoptical.cn/impreset/file/upload/getcloudviewFile',
      form: [],
      model: {
        name: '111'
      },
      timelineList: null,
      rightComplete: false,
      leftComplete: false
    }
  },
  computed: {
    ...mapGetters(['name'])
  },
  mounted() {},
  methods: {
    ceshi: function() {
      this.$store.dispatch('kunkkaFormTableDialog/toggleSetModel', {
        visible: true,
        form: {
          conditions: [
            // {
            //   label: '工号',
            //   prop: 'id',
            //   type: 'input',
            //   show: true
            // }, {
            //   label: '姓名',
            //   prop: 'name',
            //   type: 'input',
            //   show: true
            // },
            // {
            //   label: '轮播图',
            //   prop: 'image',
            //   type: 'simpleuploadimg',
            //   show: true
            // },
            // {
            //   label: '远程搜索',
            //   prop: 'autocompleteSelect',
            //   type: 'autocompleteSelect',
            //   show: true
            // },
            // {
            //   label: 'select',
            //   prop: 'select',
            //   type: 'select',
            //   show: true,
            //   optionlist: [
            //     {
            //       cKeyname: '111',
            //       cKeynumb: '111'
            //     }
            //   ]
            // }
          ],
          rules: {
            id: [
              {
                required: true,
                message: '请填写工号',
                trigger: 'blur'
              }
            ]
          },
          model: {
            id: '001',
            name: '张三'
          }
        },
        table: {
          defaultHandle: ['add2', 'copy2', 'del'],
          handle: [{
            label: '自定义按钮'
          }],
          columns: [
            {
              label: '工号',
              prop: 'id',
              type: 'input',
              show: true
            },
            {
              label: '姓名',
              prop: 'name',
              type: 'input',
              show: true
            }
          ],
          data: [{
            id: '111',
            name: '张三'
          }],
          rules: {
            id: [{ required: true, message: '请填写工号', trigger: 'blur' }],
            name: [{ required: true, message: '请填写姓名', trigger: 'change' }]
          }
        },
        handle: [
          {
            label: '确定',
            vaild: true
          },
          {
            label: '取消'
          }
        ]
      })
    },
    toggleClick(data) {
      console.log(data)
    },
    toggleSelectRow(row) {
      console.log(row)
    }
  }
}
</script>
<style lang="scss">
.Kunkka-collapse-form {
  .el-form-item--mini.el-form-item {
    margin-bottom: 0;
  }
}
</style>
